TreeGrid Gantt Chart Tutorial
14. Calendars - excluded dates
Excluding any dates from chart and Gantt calculation
-
Available calendars in chart are defined in root
Calendars
tag, by individual E
tags.
Every calendar has defined its Name and all dates to exclude in Exclude tag.
The calendard are accessible also by API by Calendars array.
-
The
format
of Exclude or GanttExclude is: rep1#date1a~date1b;rep2#date2a~date2b;...
The repeater can be one of GanttDataUnits. If it is missing, the date is not repeated. The date is repeated also before it.
For example: GanttExclude = ‘w#1/5/2008~1/7/2008; d#00:00~9:00; d#13:00~14:00; d#18:00~24:00’ shows only hours 8:00 – 13:00 and 14:00 – 18:00 and only workdays.
-
The excluded dates are completely ignored in Gantt calculation, they behave like there are no such dates at all.
-
If the excluded dates are shown, they are colored in different color and usually do not permit to place objects here, see GanttCheckExclude.
The excluded dates are color before background, so by GanttBackground is possible to change their color.
-
GanttCheckExclude
attribute controls if it will be possible to place some objects to excluded dates.
Remember, even if the object contains excluded dates, they are still excluded from all calculations, like dependency or duration.
The checking affects also editing Gantt source columns by a user.
0 - permits placing, 1 - restricts placing, 2 - asks user.
-
Global calendar
is defined by GanttExclude
tag. It affects all rows without local calendar.
The GanttExclude can be set to the name of calendar defined in Calendars tag or directly to exclude string.
The excluded dates by global calendar can be shown or hidden in the chart, according to GanttHideExclude
value.
Dynamically can be the GanttHideExclude changed by API method SetHideExclude.
-
Local calendars
can be defined individually for every row by GanttCalendar
attribute.
The GanttCalendar can be set for the whole column to another grid column that contains calendar names or direct exclude strings.
Or can be set individually for every row to the calendar name, exclude string or the column containing this information. In this case the Gantt column must have set the GanttCalendar attribute to some value too.
-
ShowGanttCalendar API method presets cell Defaults list to the list of calendar to let users to choose and assign a calendar to the local or global calendar.
It can be used in OnClickSideDefaults event.
-
EditGanttCalendars API method shows the global dialog to let users to edit, add and delete available calendars.
-
If the calendar changes, the bars in rows must be recalculated. It is possible to recalculate bar duration according to its end or its end according to the duration.
For main bar and flow it is chosen by GanttChangeExclude attribute. The Run bars change depends if the bars are defined by width or by end.
-
The calendar be changed and updated also by API method ChangeExclude.